//
//  JMCommonMethod.h
//  JMBaseProject
//
//  Created by Liuny on 2018/8/23.
//  Copyright © 2018年 liuny. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
typedef void(^returnBlock)(NSString *imageUrl);
typedef void(^returnBlocks)(NSArray *imageUrls);
typedef void(^failBlock)(NSString *errorMsg);


//typedef enum : NSInteger{
//    track_Type_button,
//    track_Type_page,
//    track_Type_input,
//    track_Type_select
//} track_Type;

typedef enum : NSInteger{
    BUTTON_CLICK,
    ENTER,
    OUT,
    GET_FOCUS,
    LOST_FOCUS,
    INPUT,
    PARSE,
    SEL_GET_FOCUS,
    SEL_LOSE_FOCUS
} track_Action;
@interface JMCommonMethod : NSObject

extern NSString* BasePostRequestUrl(NSString * url);
extern NSString* fPinUrl(NSString* url);
extern NSString* h5Url(NSString* ss);
extern NSString* bundleVersion();
extern NSString* serviceUrlWith(NSString *url);
extern NSString* serviceUrl();
extern NSString* loginUserHeadImgUrlString();
extern NSURL* loginUserHeadImgURL();
+(void)pushWebviewWithUrl:(NSString *)urlString andTitle:(NSString *)title;
+(void)presentWebviewWithUrl:(NSString *)urlString andTitle:(NSString *)title;
//导航栏标题文字属性
+(NSMutableAttributedString *)navigationTitleWithColor:(UIColor *)color title:(NSString *)title;
//导航栏左右按钮文字属性
+(void)navigationItemSet:(UIButton *)item fontColor:(UIColor *)color;
//接口请求基础数据
+(NSMutableDictionary *)baseRequestParams;
//网络请求图片
+(NSURL *)imageUrlWithPath:(NSString *)imagePath;
//图片完整地址
+(NSString *)pinImagePath:(NSString *)path;
//阴影
+(void)shadowView:(UIView *)view;
//UITextField占位文字颜色
+(void)placeholderColor:(UITextField *)textField;
//html图片屏幕适配
+(NSString *)autoFitHtml:(NSString *)content;
//提交按钮
+(void)commitButtonStyle:(UIButton *)btn;
//阅读量显示规则
+(NSString *)readCountFormat:(NSString *)readCount;
//发布时间显示规则
+(NSString *)timeFormat:(NSString *)time;
//获取视频封面
+(UIImage *)coverImageForNetVideo:(NSURL *)url;
//获取本地缓存图片
+(UIImage *)coverImageForLocalCache:(NSString *)url;

//直播默认消息默认携带参数
+(NSMutableDictionary *)defaultExtraDict;
+(void)loginSuccessWithDict:(NSDictionary *)dict;


/// 统计点上传 (https://91fintek.yuque.com/zdsakl/vq7wq0/lsreu0 打点列表查看地址)
/// - Parameters:
///   - pageName: 页面名称(具体查看打点列表)
///   - actionType: 事件类型(具体查看打点列表)
///   - parameters: 需要传入的参数(具体参数名,查看打点列表) (可以为空)
+ (void )uploadStatistics:(NSString * _Nonnull)pageName
               actionType:(NSString * _Nonnull)actionType
               parameters:(NSDictionary * _Nullable)parameters;
///用户详细行为埋点
+ (void )userBehaviorTrack:(NSString * _Nonnull)pageName
               FeatureName:(NSString *)featureName
                    Action:(track_Action)action;
///风控埋点
+(void)addRiskControlTracking:(NSString *)sceneType parameters:(NSDictionary *)parameters;
+(void)openFico;
+(void)openCloudun;
+(void)openFAQ;

@end
NS_ASSUME_NONNULL_END
